class Session{
    set(key,value){
        if( typeof value == 'object' ){
            value = JSON.stringify(value)
        }
        sessionStorage.setItem(key,value)
    }

    get( key ){
        let value = sessionStorage.getItem(key) || '';
        if( value.includes('[') || value.includes('{') ){
            value = JSON.parse(value)
        }
        return value
    }

    has( key ){
        return sessionStorage.getItem(key) ? true : false
    }
}
export default new Session